/*
 * =====================================================================================
 *
 *       Filename:  ICarModel.cc
 *
 *    Description:
 *
 *        Version:  1.0
 *        Created:  01/10/2022 10:31:53 AM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  first_name last_name (fl), fl@my-company.com
 *        Company:  my-company
 *
 * =====================================================================================
 */

#include "ICarModel.h"
#include <vector>
#include <iostream>
using std::vector;
using std::string;

ICarModel::ICarModel(void) {
}

ICarModel::~ICarModel(void) {
}

void ICarModel::SetSequence(vector < string >* pSeq) {
    m_pSequence = pSeq;
}

void ICarModel::Run() {
    vector < string >::const_iterator it = m_pSequence->begin();

    for (; it < m_pSequence->end(); ++it) {
        string actionName = *it;

        if (actionName.compare("start") == 0) {
            Start();
        } else if (actionName.compare("stop") == 0) {
            Stop();
        } else if (actionName.compare("alarm") == 0) {
            Alarm();
        } else if (actionName.compare("engine boom") == 0) {
            EngineBoom();
        }
    }
}
